package com.ddwl.goods.dao.mapper;

import com.ddwl.common.dao.mapper.TkMapper;
import com.ddwl.goods.dao.model.ShoppingCart;
import com.ddwl.goods.dto.ShoppingCarItemNumDto;
import com.ddwl.schema.vo.goods.retail.ShoppingCartPageVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * (SysShoppingCart)数据库交互Mapper
 *
 * @author makejava
 * @since 2020-06-05 16:01:26
 */
public interface ShoppingCartMapper extends TkMapper<ShoppingCart> {
    /**
     * 购物车分页
     * @param userId
     * @return
     */
    List<ShoppingCartPageVo> getListGroupByShop(@Param("userId") String userId);

    /**
     * 购物车商品分组数量
     * @param userId
     * @param itemIds
     * @return
     */
    List<ShoppingCarItemNumDto> getItemNumGroupByItem(@Param("userId") String userId, @Param("itemIds") List<String> itemIds);

    /**
     * 购物车sku分组数量
     * @param userId
     * @param barcodes
     * @return
     */
    List<ShoppingCarItemNumDto> getItemNumGroupByBarcode(@Param("userId") String userId, @Param("barcodes") List<String> barcodes);
}